﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace NavFx
{
	/// <summary>
	/// Implements extension methods to support NavFx
	/// </summary>
	public static class Extensions
	{
		/// <summary>
		/// Extends a Silverlight Application to provide simpler syntax for getting reference to the NavFx Navigator
		/// </summary>
		/// <param name="app">Silverlight Application being extended</param>
		/// <returns>Reference to NavFx Navigator or null if IAppliation is not implemented</returns>
		public static Navigator GetNavigator(this System.Windows.Application app)
		{
			if(app is IApplication)
			{
				return ((IApplication)Application.Current).GetNavigator();
			}

			return null;
		}
	}
}
